#include "src/lterr.h"

#include <stdio.h>

#include "src/ltbase.h"
#include "src/ltgen.h"

lt_UsingType(lt, USize);

lterr_ErrorInfo lterr_gErrorInfos[] = {
    {
        .name = "Ok",
        .description = "ok",
    },
    {
        .name = "End",
        .description = "end of input",
    },
    {
        .name = "FileError",
        .description = "file IO error",
    },
    {
        .name = "ZeroBuf",
        .description = "empty buffer",
    },
    {
        .name = "Error",
        .description = "general error",
    },
    {NULL, NULL},
};

ltgen_Generator(lterr_IO_Error) {
    for (USize i = 0; lterr_gErrorInfos[i].name != NULL; ++i) {
        printf("    lterr_k%s,\n", lterr_gErrorInfos[i].name);
    }
    return 0;
}
